#
# * Android r5 gcc-4.4.3 ARM SDK Makefile include
# * $URL$
# * $ID$
#
#Copyright (c) 2010, 32bitmicro
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation 
#and/or other materials provided with the distribution.
#Neither the name of the 32bitmicro nor the names of its contributors may be used to endorse or promote products derived from this software without 
#specific prior written permission.
#
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
#BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
#SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
#DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
#NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

GCC_PREFIX=arm-linux-androideabi
GCC_CMD_PREFIX=
GCC_CMD_POSTFIX=
GCC_VERSION=4.4.3

TARGET_SDK_OUT=elf
TARGET_SDK_USE_DEFAULT_LDSCRIPT=1
TARGET_NDK_ROOT=${32BITMICRO}/${HOST_OS}/android-ndk-r5
TARGET_SDK_ROOT=${TARGET_NDK_ROOT}/toolchains/${GCC_PREFIX}-${GCC_VERSION}/prebuilt/windows
TARGET_SDK_PREFIX=${TARGET_SDK_ROOT}/bin/${GCC_PREFIX}-

include  $(32BITMICRO)/src/make/Makefile.gcc

#ANDROID_PLATFORM=android-3
#ANDROID_PLATFORM=android-4
#ANDROID_PLATFORM=android-5
ANDROID_PLATFORM=android-8

# Target SDK flags
TARGET_SDK_CFLAGS+=-fpic -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums \
-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ \
-Wno-psabi -march=armv5te -mtune=xscale -msoft-float \
-Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \
-DANDROID  -Wa,--noexecstack


# Logged options when compiling shared library
#-fpic -mthumb-interwork 
#-ffunction-sections -funwind-tables -fstack-protector -fno-short-enums 
#-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__
#-Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb 
#-Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64  
#-I/usr/local/hobby-robotics/src/hbbrbasic/hbbrlib/libruntime/android/jni 
#-DANDROID  -Wa,--noexecstack -O2 -DNDEBUG -g -c -MMD -MP -MF 

# Thumb 
# TARGET_SDK_CFLAGS+=-mthumb -mthumb-interwork-

# What are those?
#  -MMD -MP -MF

# Debug
#TARGET_SDK_CFLAGS+=-DNDEBUG -g -c
# Optimizationm
#TARGET_SDK_CFLAGS+= -O2

#TARGET_SDK_CC_INCLUDE_PATH+=-I${TARGET_SDK_ROOT}/include
#TARGET_SDK_CC_INCLUDE_PATH+=-I${TARGET_NDK_ROOT}/build/platforms/$(ANDROID_PLATFORM)/arch-arm/usr/include
#TARGET_SDK_LDFLAGS +=-L${TARGET_SDK_ROOT}/lib
#TARGET_SDK_LDFLAGS +=-L${TARGET_NDK_ROOT}/build/platforms/$(ANDROID_PLATFORM)/arch-arm/usr/lib
# android-3



#TARGET_SDK_LIBS+=-lc -lm -lstdc++ -lthread_db  
#TARGET_SDK_LIBS+=libc libm libz liblog libjnigraphics 

